FROM ubuntu:20.04

RUN apt update -y && apt install -y curl
RUN curl -fsSL https://code-server.dev/install.sh | sh

RUN apt install -y \
      git gcc wget gzip busybox sudo

RUN useradd user
RUN mkdir /home/user
RUN chown user /home/user

# USER user
# RUN code-server --install-extension rust-lang.rust-analyzer
# RUN code-server --install-extension ms-vscode.atom-keymap
# RUN code-server --install-extension emroussel.atomize
# RUN code-server --install-extension pkief.material-icon-theme
# RUN code-server --install-extension tamasfe.even-better-toml

RUN echo ". ~/.profile" > /home/user/.bashrc
RUN echo "PS1='\W\\$ '" > /home/user/.bashrc


USER root
RUN busybox --install /bin
RUN chsh -s bash

CMD bash -c "code-server --bind-addr 0.0.0.0:8443 --auth none "